<template>
  <div id="app">
    <el-form label-width="100px">
      <el-form-item label="excel">
        <el-upload
          class="upload-demo"
          action="http://localhost:8989/student/importExcel"
          :limit="1"
          :on-exceed="handleOnExceed"
          name="excelFile"
          accept=".xls"
          :multiple="false"
          :on-success="handleOnSuccess"
        >
          <el-button size="small" type="primary">点击上传</el-button>
          <div slot="tip" class="el-upload__tip">只能上传xls文件</div>
        </el-upload>
      </el-form-item>

    </el-form>
  </div>
</template>

<script>
  export default {
    data(){
    },
    methods:{
      handleOnExceed(){
        console.log("文件个数超出限制");
      },
      handleOnSuccess(resp){
        this.$message.success("导入成功！")
        //文件上传成功之后要把文件上传到哪传给brand对象
        this.router.push("/classstudent/StudentList")
      },
    }
  }
</script>


<style scoped>

</style>
